package com.rui.study.micro.goods.support;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.core.env.Environment;
import org.springframework.stereotype.Component;

@Component
public class SimpleApplicationRunner implements ApplicationRunner {

    @Autowired
    private Environment environment;

    @Override
    public void run(ApplicationArguments args) throws Exception {
        System.out.println("Runner回调>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>");
        System.out.println("datasource.db.driver-class-name = " + environment.getProperty("datasource.db.driver-class-name"));
        System.out.println("datasource.db.password = " + environment.getProperty("datasource.db.password"));
        System.out.println("datasource.db.type = " + environment.getProperty("datasource.db.type"));
        System.out.println("datasource.db.url = " + environment.getProperty("datasource.db.url"));
        System.out.println("datasource.db.username = " + environment.getProperty("datasource.db.username"));

    }
}
